package com.ibiaoke.goods.service;

import com.ibiaoke.common.base.Page;
import com.ibiaoke.goods.dao.ReserveGoodsDao;
import com.ibiaoke.goods.entity.ReserveGoods;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.Date;
import java.util.List;

@Service
public class ReserveGoodsServiceImpl implements ReserveGoodsService{

    @Autowired
    private ReserveGoodsDao reserveGoodsDao;

    @Override
    public Integer addReserveGoods(String userName, Integer shopId, ReserveGoods reserveGoods) {
        reserveGoods.setOperator(userName);
        reserveGoods.setShopId(shopId);
        reserveGoods.setCreateTime(new Date());
        return reserveGoodsDao.insert(reserveGoods);
    }

    @Override
    public List<ReserveGoods> findGoodStockList(String goodName, Integer goodId, Date reserveStartTime,
                                                Date reserveEndTime, Integer shopId, Page page) {
        return reserveGoodsDao.findGoodStockList(goodName,goodId,reserveStartTime,reserveEndTime,shopId,page);
    }
}
